package cn.school.thoughtworks.section3;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class PracticeC {
    Map<String,Integer> createUpdatedCollection(List<String> collectionA, Map<String,List<String>> object) {

        Map<String, Integer> nameMap = new HashMap();

        collectionA.forEach(name -> nameMap.compute(name, (k, v) -> v == null ? 1 : ++v));
        List<String> list1=object.get("value");

        for (String s:list1){
            nameMap.put(s, nameMap.get(s)-nameMap.get(s)/3);

        }

        return nameMap;
    }
}